adding border to text css

39

h1 {
    /* 1 pixel black shadow to left, top, right and bottom */
    text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;

    font-family: sans; color: yellow;
}
h1 {
  -webkit-text-stroke: 1px black;
}
h1 {
    -webkit-text-stroke: 2px black; /* width and color */

    font-family: sans; color: yellow;
}
<p style="border:3px; border-style:solid; border-color:#FF0000; padding: 1em;">
  First example with text surrounded by a red border.<br>This example also has multiple lines.
</p>

Comments

Submit
0 Comments